An Efficient Preprocessing on the One-dimensional Real-scale Pattern Matching Problem
نویسندگان
چکیده
Given a pattern string P and a text string T , the one-dimensional real-scale pattern matching problem asks for all matched positions in T at which P occurs for some real scales ≥ 1. This problem was first proposed by Amir et al., who also gave an algorithm with O(n + |P |) time for solving it, where |T | = n. Recently, Wang et al. proposed a preprocessing on T with O(n) time and space, with which for constant-sized alphabets, one can determine all matched positions in O(|P |+Ur) time, where Ur denotes the number of matched positions. For large-sized alphabets, with Wang’s preprocessing, it takes O(|P |+Ur + logn) time to report all matched positions. In addition, Wang et al. also proposed a preprocessing on T with O(n) time and space, with which one can answer the decision version of the real-scale matching problem on constant-sized and large-sized alphabets in O(|P |) and O(|P |+ logn) time, respectively. In this paper, we propose an improved preprocessing for this problem. For constant-sized alphabets, our preprocessing takes only O(n) time and space, while reporting all matched positions requires O(|P | + w) time, where w ≤ Ur. For the case of large-sized alphabets, our preprocessing can also be implemented with O(n) time and space, and then all matched positions can be determined in O(|P |+w+log n) time. Compared with Wang’s result, our algorithm is more efficient in both preprocessing and searching phases.
منابع مشابه
Efficient One Dimensional Real Scaled Matching
Real Scaled Matching is the problem of finding all locations in the text where the pattern, proportionally enlarged according to an arbitrary real-sized scale, appears. Real scaled matching is an important problem that was originally inspired by Computer Vision. In this paper, we present a new, more precise and realistic, definition for one dimensional real scaled matching, and an efficient alg...
متن کاملEfficient Preprocessings on the One-dimensional Discretely Scaled Pattern Matching Problem
Let P and T be a pattern and a text strings, respectively. The one-dimensional discretely scaled pattern matching problem is to ask for all valid positions in T that some discrete scales of P occur in these positions. Amir et al. first showed that this problem can be solved in O(n) time by adapting Eilam-Tzoreff and Vishkin’s algorithm. Recently, Wang et al. showed that when the size of the alp...
متن کاملOptimally fast parallel algorithms for preprocessing and pattern matching in one and two dimensions
All algorithms below are optimal alphabet-independent parallel CRCW PRAM algorithms. In one dimension: Given a pattern string of length m for the string-matching problem, we design an algorithm that computes a deterministic sample of a suu-ciently long substring in constant time. This problem used to be a bottleneck in the pattern preprocessing for one-and two-dimensional pattern matching. The ...
متن کاملDuel and Sweep Algorithm for Order-Preserving Pattern Matching
Given a text T and a pattern P over alphabet Σ, the classic exact matching problem searches for all occurrences of pattern P in text T . Unlike exact matching problem, order-preserving pattern matching (OPPM) considers the relative order of elements, rather than their real values. In this paper, we propose an efficient algorithm for OPPM problem using the “duel-and-sweep” paradigm. Our algorith...
متن کاملOn the inverse maximum perfect matching problem under the bottleneck-type Hamming distance
Given an undirected network G(V,A,c) and a perfect matching M of G, the inverse maximum perfect matching problem consists of modifying minimally the elements of c so that M becomes a maximum perfect matching with respect to the modified vector. In this article, we consider the inverse problem when the modifications are measured by the weighted bottleneck-type Hamming distance. We propose an alg...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2008